function EGFPVsMut2Kymograph
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here

global expPath;

Save_for_paper = 0;

trim = 50; %40; %pixells to trim from top and bottom of blended image
shift = 0; %12; %pixels to shift the image if it is not centered

%% Define starting dir
if ~isempty(expPath)
    startPath = expPath;
else
    disp('Use SetExpPath to indicate location of colony files')
    return
end
load([startPath '\annotation.mat']);

%% SCFP3A
startSCFP = 65; %Index of first frame
nFrameSCFP = 55;

%% Load SCFP colony
load([startPath '\colony-FOV001-006_conn_mut2.mat']);

colony.exp = annotation.exp;
colony.chip = annotation.chip;
bounds = colony.bounds;
colonyLim = colony.colonyLim;

%Construct Flscnc kymograph
underImgF = [];
for i=startSCFP:startSCFP+nFrameSCFP
    underImgF = [underImgF; colony.image{end-1}(bounds(i):(bounds(i+1)-1), :)];
end
flscnc = underImgF';
flscncSCFP = flscnc(1+trim+shift:end-trim+shift,:);

%Construct PC kymograph
underImgPC = [];
for i=startSCFP:startSCFP+nFrameSCFP
    underImgPC = [underImgPC; colony.image{end}(bounds(i):(bounds(i+1)-1), :)];
end
PC = underImgPC';
PC_SCFP = PC(1+trim+shift:end-trim+shift,:);


%% Turq
startTurq = 65; %Index of first frame
nFrameTurq = 55;

load([startPath '\colony-FOV002-002_conn_mut1.mat']);

colony.exp = annotation.exp;
colony.chip = annotation.chip;
bounds = colony.bounds;
colonyLim = colony.colonyLim;

%Construct fluorescence kymograph
underImgF = [];
for i=startTurq:startTurq+nFrameTurq
    underImgF = [underImgF; colony.image{end-1}(bounds(i):(bounds(i+1)-1), :)];
end
flscnc = underImgF';
%flscnc = imresize(flscnc, 0.75);
flscncTurq = flscnc(1+trim+shift:end-trim+shift,:);

%Construct PC kymograph
underImgPC = [];
for i=startSCFP:startSCFP+nFrameSCFP
    underImgPC = [underImgPC; colony.image{end}(bounds(i):(bounds(i+1)-1), :)];
end
PC = underImgPC';
%flscnc = imresize(flscnc, 0.75);
PC_Turq = PC(1+trim+shift:end-trim+shift,:);

%% PC image
kymographPC_h = figure('Color',[1 1 1]);
plot([1 1], [1 1], 'w');

PC = [PC_SCFP; PC_Turq];
PC = im2uint8(mat2gray(PC));
im_h = image(PC);
colormap(gray(2^8));

dim = size(PC);

% %Scale bar
yinf = dim(1)-130;
ysup = yinf - 40/0.1582;
line([40 40],[yinf ysup], 'Color', 'w', 'LineWidth', 2.5)
str5 = {'\fontsize{18}40 \mum'};
scalebar_h = text(40+10,yinf - 20/0.1582, str5, 'Color', 'w');

%Time bar
xwidth = bounds(2) - bounds(1)-1;
line([0 5]*xwidth + 80,[dim(1)-50 dim(1)-50], 'Color', 'w', 'LineWidth', 2.5)
str6 = {'\fontsize{18}25 min'};
timebar_h = text(80+0.90*xwidth,dim(1)-105, str6, 'Color', 'w');

%Phase contrast legen
xwidth = bounds(2) - bounds(1)-1;
str6 = {'\fontsize{14}Phase Contrast'};
timebar_h = text(900+0.6*xwidth,dim(1)-50, str6, 'Color', 'w');

%Phase contrast legen
xwidth = bounds(2) - bounds(1)-1;
str6 = {'\fontsize{18}Fast and Dim', '\fontsize{15}SCFP3A'};
timebar_h = text(750+0.6*xwidth, 100, str6, 'Color', 'w');

%Phase contrast legen
xwidth = bounds(2) - bounds(1)-1;
str6 = {'\fontsize{18}Slow and Bright', '\fontsize{15}mTurquoise2'};
timebar_h = text(750+0.6*xwidth, dim(1)/2 + 100, str6, 'Color', 'w');

line([0 dim(2)+10], [1 1]*dim(1)/2, 'Color', 'w', 'LineWidth', 2.5)

axis equal;
% set(gca,'xcolor',get(gcf,'color'));
set(gca,'XTick',[]);
% set(gca,'YTickLabel',[])
set(gca,'YTick',[])
% set(gca,'ycolor','w')
% set(0,'defaultaxesposition',[0 0 1 1])
box off;


%% Fluorescence image
kymographF_h = figure('Color',[1 1 1]);
% plot([1 1], [1 1], 'w');
axes('position', [0 0 1 1])

Flscnc = [flscncSCFP; flscncTurq];
Flscnc = im2uint8(mat2gray(Flscnc));
im_h = image(Flscnc);
colormap(gray(2^8));

dim = size(Flscnc);

threshold = 0.50;
M = round(256*threshold);
G1 = linspace(0,threshold,M);
blackG1 = zeros(size(G1));
G2 = linspace(threshold,1,256-M);
blackG2 = zeros(size(G2));


myGmap = horzcat([blackG1 G2]', [blackG1 G2]', [blackG1 G2*0.4]');
colormap(myGmap);
set(im_h, 'CDataMapping', 'direct');

% %Scale bar
yinf = dim(1)-130;
ysup = yinf - 40/0.1582;
line([40 40],[yinf ysup], 'Color', 'w', 'LineWidth', 2.5)
str5 = {'\fontsize{18}40 \mum'};
scalebar_h = text(40+10,yinf - 20/0.1582, str5, 'Color', 'w');

%Time bar
xwidth = bounds(2) - bounds(1)-1;
line([0 5]*xwidth + 80,[dim(1)-50 dim(1)-50], 'Color', 'w', 'LineWidth', 2.5)
str6 = {'\fontsize{18}25 min'};
timebar_h = text(80+0.0*xwidth,dim(1)-105, str6, 'Color', 'w');

%Phase contrast legen
xwidth = bounds(2) - bounds(1)-1;
str6 = {'\fontsize{18}Fast', '\fontsize{15}mGFPmut2'};
timebar_h = text(2050+0.6*xwidth, dim(1)/2 - 100, str6, 'Color', 'w');

%Phase contrast legen
xwidth = bounds(2) - bounds(1)-1;
str6 = {'\fontsize{18}Slow', '\fontsize{15}mEGFP'};
timebar_h = text(2050+0.6*xwidth, dim(1) - 100, str6, 'Color', 'w');

line([0 dim(2)+10], [1 1]*dim(1)/2, 'Color', 'w', 'LineWidth', 2.5)

axis equal;
box off;
set(gca,'XTick',[]);
set(gca,'YTick',[])

colorbar;

end
